{% extends 'base.html' %}
{% load viewflow %}

{% block nav_queue_cls %}class="active"{% endblock %}

{% block content %}
<h2 class="center">{{ view.flow_class }}</h2>
<div class="row">
  <div class="col s12 m12 l8 offset-l2">
    <table id="table" class="table bordered">
      <thead>
        <td>#</td>
        <td>Created</td>
        <td>Description</td>
        <td>Planet</td>
      </thead>
      <tbody>
        {% for task in queue %}
        {% flowurl task user=request.user as task_url %}
        <tr>
          <td>
            {% if task_url %}<a href="{{ task_url }}">{{ task.process.pk }}/{{ task.pk }}</a>{% else %}{{ task.process.pk }}/{{ task.pk }}{% endif %}
          </td>
          <td>{{ task.created }}</td>
          <td>{{ task.summary|default:task.flow_task }}</td>
          <td>{{ task.flow_process.planet }}</td>
        </tr>
        {% empty %}
        <tr>
          <td colspan="4">No tasks in queue</td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
</div>
{% endblock %}
